package com.wzy.webflux.util;

import com.wzy.webflux.excetption.CheckException;

import java.util.Arrays;

public class CheckUtil {
    private static final String[] Invalid_Dames = {"admin", "root"};

    public static void checkNames(String str) {
        Arrays.stream(Invalid_Dames).filter(username -> username.equalsIgnoreCase(str))
                .findAny().ifPresent(username -> {
            throw new CheckException("name", username);
        });

    }
}
